<template>
  <view>
    <!-- 轮播图区域 -->
    <swiper
      :indicator-dots="true"
      :autoplay="true"
      :interval="3000"
      :duration="1000"
      :circular="true"
    >
      <swiper-item v-for="(item, index) in info.goods_images" :key="index">
        <image :src="item.external_url"></image>
      </swiper-item>
    </swiper>
  </view>
</template>

<script>
export default {
  data(){
    return {
      info:{}
    }
  },
  onLoad({goodsId}){
    this.getProDetail(goodsId)
  },
  methods:{
    async getProDetail(goodsId){
      const res = await this.$http.get('/goods/detail',{
        goodsId
      })
      if (res.status !== 200) return this.$msg()
      // console.log(res.data.detail)
    this.info = res.data.detail
    }
  }
}
</script>

<style lang="scss" scoped>
swiper {
  height: 750rpx;

  image {
    width: 100%;
    height: 100%;
  }
}
</style>